package com.go.controller;



import com.go.model.User;
import com.go.service.ServiceInstance;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

/**
 * 用户控制层
 * @author lyb
 *
 */
public class GoUserController extends Controller{
	
	//访问路径 local:port/项目名/goUser  就可以    index()方法名为index，省略
	public void index(){
		setAttr("userName", "张三");
		render("/WEB-INF/view/user.jsp");
	}
	
	//访问路径 local:port/项目名/goUser/findUser      
	public void findUser(){
		//Integer id = getParaToInt("id");//获取id参数
		//String name = getPara("name"); //获取name参数
		//User user =getModel(User.class); //获取user表单数据
		
		//int result = ServiceInstance.userService.updateStatus(1, 1);
		
		Page<User> users = ServiceInstance.userService.paginate(1, 10, null, false);
		renderJson(users); //返回json格式的数据  
	}
}
